<nav class="navbar navbar-fixed-top navbar-inverse">

  <div class="container">
    <div class="navbar-header navbar-header-logo">      
        <%= link_to "记事本", "#", id: "logo" %>      
    </div>
 
    <div class="navbar-collapse collapse" id="navbarNav" style="">
      <ul class="nav navbar-nav navbar-right">
        <% if logged_in? %>
        <li id="monthtask"><%= link_to "本月事件", current_user %></li>
        <li><%= link_to "新建事件", task_new_path %></li>
        <li id="userid" style="display:none;"><%= current_user.id %></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            <%= current_user.name + '(' + current_user.number + ')'%>
            <b class="caret"></b>
          </a>
          <ul class="dropdown-menu">
            <li>
              <%= link_to "修改密码", edit_user_path(current_user) %>
            </li>
            <li class="divider"></li>
            <li>
              <%= link_to "注销", logout_path, method: :delete %>
            </li>
          </ul>
        </li>
        <% else %>
        <li>
          <%= link_to "Log in", login_path %>
        </li>
        <% end %>
      </ul>
    </div>
  </div>
</nav>